home *** CD-ROM | disk | FTP | other *** search
/ Sigcat 1994: Conference Disk / SIGCAT 94 Conference Disk - DataDisc.ISO / cdcomp / comp1.bas < prev    next >
Encoding:
BASIC Source File  |  1994-04-10  |  6.2 KB  |  293 lines

  1.  
  2. REM This program will read the ASCII file containing the SIGCAT CD-ROM
  3. REM Compendium converted from WordPerfect 5.1 and parse the fields
  4. REM into a GSSEARCH TAG file format
  5. REM 4/9/94
  6. REM
  7. CLS
  8. SCREEN 9
  9. DIM V$(100)
  10. DIM S$(100)
  11.  
  12.  
  13. INPUT "Input ASCII file to be processed "; FIN$
  14. OPEN "I", #1, FIN$
  15. REM OPEN "I", #1, "COMPIN"
  16.  
  17. INPUT "Output GSSEARCH TAG file to be created "; FOUT$
  18. OPEN "O", #2, FOUT$
  19. REM OPEN "O", #2, "COMPOUT"
  20.  
  21.  REM First read to find start line:
  22.  REM * in Col. 1
  23.  
  24.  A$ = ""
  25.  WHILE NOT EOF(1)
  26.    REM Read and start processing
  27.  
  28.  WHILE MID$(A$, 1, 1) <> "*"
  29.    IF EOF(1) THEN 400
  30.    LINE INPUT #1, A$
  31. REM    PRINT a$
  32. REM    INPUT "Cont"; Q$
  33.  
  34.  WEND
  35.  
  36.    PRINT #2, "{TITLE}" + MID$(A$, 2, 79)
  37.  
  38. REM Read past blanks looking for either "Subtitle" or "Description"
  39.   LINE INPUT #1, A$
  40.  
  41.  WHILE MID$(A$, 1, 1) = ""
  42.    LINE INPUT #1, A$
  43.  WEND
  44.  
  45.  
  46.  IF MID$(A$, 1, 3) = "Sub" THEN
  47.    PRINT #2, "{SUBTITLE}" + LTRIM$(MID$(A$, 10, 79))
  48.    REM Read past blanks looking for "Description"
  49.    LINE INPUT #1, A$
  50.    WHILE MID$(A$, 1, 1) = ""
  51.      LINE INPUT #1, A$
  52.    WEND
  53.  END IF
  54.  
  55.  IF MID$(A$, 1, 3) = "Des" THEN
  56.    PRINT #2, "{DESCRIPT}" + LTRIM$(MID$(A$, 13, 85))
  57.    LINE INPUT #1, A$
  58.  END IF
  59.  
  60. REM Print description lines until "Documentation" found:
  61. REM Print remainder of first line:
  62.  PRINT #2, MID$(A$, 1, 80)
  63.  LINE INPUT #1, A$
  64.  WHILE MID$(A$, 1, 14) <> "Documentation:"
  65.    PRINT #2, A$
  66.    LINE INPUT #1, A$
  67.  WEND
  68.    PRINT #2, "{DOCUMENTED}" + LTRIM$(MID$(A$, 15, 79))
  69. REM Read past blanks looking for "Vendor"
  70.   LINE INPUT #1, A$
  71.  
  72.  WHILE MID$(A$, 1, 7) <> "Vendor/"
  73.    LINE INPUT #1, A$
  74.  WEND
  75. REM Vendor line found
  76. REM read next lines into V$ and S$ arrays until "Local Area" or "*" found
  77.   x = 1
  78.   y = 1
  79.  
  80. REM initialize arrays to all "@"
  81. WHILE x < 100
  82.   V$(x) = "@"
  83.   S$(x) = "@"
  84.   x = x + 1
  85. WEND
  86.   x = 1
  87.   y = 1
  88.  
  89.  WHILE MID$(A$, 1, 10) <> "Local Area" AND MID$(A$, 1, 1) <> "*"
  90.   IF EOF(1) THEN 69
  91.   LINE INPUT #1, A$
  92. REM PRINT A$
  93. REM INPUT "THIS WAS THE WHOLE LINE...OK"; q$
  94.  
  95.  
  96.   REM skip garbage line:
  97.   IF MID$(A$, 2, 4) <> MID$(A$, 8, 4) THEN
  98.     V$(x) = MID$(A$, 1, 30)
  99. REM    PRINT V$(x)
  100. REM    INPUT "THIS WAS V$(x)"; q$
  101.  
  102.     x = x + 1
  103.   END IF
  104.  
  105.   IF MID$(A$, 32, 4) <> MID$(A$, 38, 4) THEN
  106.     S$(y) = MID$(A$, 31, 50)
  107.     y = y + 1
  108.   END IF
  109.  
  110.  WEND
  111.  
  112. REM At this point, the arrays are filled; process them:
  113. REM print arrsys
  114. REM x = 1
  115. REM WHILE x < 100
  116. REM PRINT V$(x)
  117. REM x = x + 1
  118. REM WEND
  119. REM INPUT "END OF V ARRAY"; q$
  120.  
  121. REM x = 1
  122. REM WHILE x < 100
  123. REM PRINT S$(x)
  124. REM x = x + 1
  125. REM WEND
  126. REM INPUT "END OF V ARRAY"; q$
  127.  
  128. 69
  129.  
  130. PRINT #2, "{SUPPLIER}"
  131. REM output lines until "Contact:" found
  132. x = 1
  133. WHILE MID$(V$(x), 1, 8) <> "Contact:"
  134.   REM outputting SUPPLIER lines:
  135.   PRINT #2, V$(x)
  136.   IF MID$(V$(x), 1, 1) = "@" GOTO 100
  137.   x = x + 1
  138. WEND
  139.  
  140. PRINT #2, "{CONTACT}"
  141. REM output lines until "Status" found
  142. REM skip "Contact:" line:
  143. x = x + 1
  144.   IF MID$(V$(x), 1, 1) = "@" GOTO 100
  145.  
  146. WHILE MID$(V$(x), 1, 6) <> "Status"
  147.   REM outputting CONTACT lines:
  148.   PRINT #2, V$(x)
  149.   IF MID$(V$(x), 1, 1) = "@" GOTO 100
  150.   x = x + 1
  151. WEND
  152.  
  153.   PRINT #2, "{STATUS}"
  154.   REM skip "Status" line:
  155.   x = x + 1
  156.   IF MID$(V$(x), 1, 1) = "@" GOTO 100
  157.   PRINT #2, LTRIM$(MID$(V$(x), 8, 30))
  158.  
  159. REM search for "Entry Dated:"
  160. WHILE MID$(V$(x), 1, 12) <> "Entry Dated:"
  161.   IF MID$(V$(x), 1, 1) = "@" GOTO 100
  162.   x = x + 1
  163. WEND
  164.  
  165.   PRINT #2, "{CTRL_DATE}" + LTRIM$(MID$(V$(x), 13, 20))
  166.  
  167. REM search for "Release Freq"
  168. WHILE MID$(V$(x), 1, 12) <> "Release Freq"
  169.   IF MID$(V$(x), 1, 1) = "@" GOTO 100
  170.   x = x + 1
  171. WEND
  172.   PRINT #2, "{RELEASED}" + LTRIM$(MID$(V$(x), 19, 30))
  173.  
  174. REM search for "Number of Di"
  175. WHILE MID$(V$(x), 1, 12) <> "Number of Di"
  176.   IF MID$(V$(x), 1, 1) = "@" GOTO 100
  177.   x = x + 1
  178. WEND
  179.   PRINT #2, "{NUM_DISCS}" + LTRIM$(MID$(V$(x), 17, 30))
  180.  
  181. REM search for "Price:"
  182. WHILE MID$(V$(x), 1, 6) <> "Price:"
  183.   IF MID$(V$(x), 1, 1) = "@" GOTO 100
  184.   x = x + 1
  185. WEND
  186.   PRINT #2, "{PRICE}" + LTRIM$(MID$(V$(x), 7, 30))
  187.  
  188.  
  189.  
  190. 100 REM The VENDOR STUFF has been output at this point; now SOURCE STUFF
  191. REM ********************************************************************
  192.  
  193.  
  194. PRINT #2, "{SOURCE}"
  195. REM SOURCE lines until "Contact:" found
  196. x = 1
  197. WHILE MID$(S$(x), 1, 8) <> "Contact:"
  198.   REM outputting SOURCE lines:
  199.   PRINT #2, S$(x)
  200.   IF MID$(S$(x), 1, 1) = "@" GOTO 200
  201.   x = x + 1
  202. WEND
  203.  
  204. PRINT #2, "{SPECIFIC}"
  205. REM output lines until "Technical" found
  206. REM skip "Contact:" line:
  207. x = x + 1
  208.   IF MID$(S$(x), 1, 1) = "@" GOTO 200
  209.  
  210. WHILE MID$(S$(x), 1, 9) <> "Technical"
  211.   REM outputting CONTACT lines:
  212.   PRINT #2, S$(x)
  213.   IF MID$(S$(x), 1, 1) = "@" GOTO 200
  214.   x = x + 1
  215. WEND
  216.  
  217.   PRINT #2, "{HARDWARE}"
  218.   REM skip "Technical" line:
  219.   x = x + 1
  220.   IF MID$(S$(x), 1, 1) = "@" GOTO 200
  221.   PRINT #2, LTRIM$(MID$(S$(x), 11, 30))
  222.   REM skip line:
  223.   x = x + 1
  224.  
  225. REM output remaining hardware info while searching for "CD Format:"
  226. WHILE MID$(S$(x), 1, 10) <> "CD Format:"
  227.   PRINT #2, S$(x)
  228.   IF MID$(S$(x), 1, 1) = "@" GOTO 200
  229.   x = x + 1
  230. WEND
  231.  
  232.   PRINT #2, "{CD_FORMAT}" + LTRIM$(MID$(S$(x), 11, 20))
  233.   REM skip line:
  234.   x = x + 1
  235.  
  236. REM search for "Operating"
  237. WHILE MID$(S$(x), 1, 9) <> "Operating"
  238.   IF MID$(S$(x), 1, 1) = "@" GOTO 200
  239.   x = x + 1
  240. WEND
  241.   PRINT #2, "{OPER_SYS}" + LTRIM$(MID$(S$(x), 21, 30))
  242.   REM skip line:
  243.   x = x + 1
  244.  
  245. REM output operating sys info while searching for "Memory Req"
  246. WHILE MID$(S$(x), 1, 10) <> "Memory Req"
  247.   PRINT #2, S$(x)
  248.   IF MID$(S$(x), 1, 1) = "@" GOTO 200
  249.   x = x + 1
  250. WEND
  251.   PRINT #2, "{MEMORY_REQ}" + LTRIM$(MID$(S$(x), 20, 30))
  252.   REM skip line:
  253.   x = x + 1
  254.  
  255. REM search for "Software:"
  256. WHILE MID$(S$(x), 1, 9) <> "Software:"
  257.   IF MID$(S$(x), 1, 1) = "@" GOTO 200
  258.   x = x + 1
  259. WEND
  260.   PRINT #2, "{SRCH_SOFT}" + LTRIM$(MID$(S$(x), 10, 30))
  261.   REM skip line:
  262.   x = x + 1
  263.  
  264. REM output remaining search soft info while searching for "Video:"
  265. WHILE MID$(S$(x), 1, 6) <> "Video:"
  266.   PRINT #2, S$(x)
  267.   IF MID$(S$(x), 1, 1) = "@" GOTO 200
  268.   x = x + 1
  269. WEND
  270.   PRINT #2, "{VIDEO_REQ}" + LTRIM$(MID$(S$(x), 7, 30))
  271.   REM skip line:
  272.   x = x + 1
  273.  
  274.  
  275. 200 REM Done
  276.  
  277.  
  278. 250 PRINT #2, "{EOR}"
  279.  
  280. 270 IF EOF(1) THEN 400
  281.  
  282. 350 WEND
  283.  
  284. 400 REM process last line
  285.  
  286.     CLS
  287.  
  288. 500 PRINT "Normal end of file on input file"
  289. 600 CLOSE 1
  290. 610 CLOSE 2
  291. 630 SYSTEM
  292.  
  293.